package MP
{
    import __AS3__.vec.Vector;
    import flash.geom.Point;
    import __AS3__.vec.*;

    public class Node 
    {

        private static var nodePool:Vector.<Node> = new Vector.<Node>();
        private static var numCount:int = 0;

        public var x:int;
        public var y:int;
        public var f:Number;
        public var g:Number;
        public var h:Number;
        public var parent:Node;
        public var walkAble:Boolean;
        public var roleBlock:Boolean = true;
        public var isMask:Boolean = false;
        public var ride:Boolean = false;
        public var ispk:Boolean = false;
        public var isSafe:Boolean = false;
        public var isJump:Boolean = false;
        public var isWabao:Boolean = false;
        public var isTaFang:Boolean = false;
        public var isXunLongJue:Boolean = false;
        public var isWeiXian:Boolean = false;
        public var isTaskNode:Boolean = false;
        private var _point:Point;

        public function Node()
        {
            this.walkAble = true;
        }
        public static function getNode():Node
        {
            var node:Node;
            if (nodePool.length == 0)
            {
                node = new (Node)();
                numCount++;
            } else
            {
                node = nodePool.pop();
            };
            return (node);
        }

        public function get pixelPoint():Point
        {
            if (this._point == null)
            {
                this._point = MapVO.getCenterPoint(this.x, this.y);
            };
            return (this._point);
        }
        public function reset():void
        {
            this.f = 0;
            this.g = 0;
            this.h = 0;
            this.x = 0;
            this.y = 0;
            this.roleBlock = true;
            this.isTaFang = false;
            this.isXunLongJue = false;
            this.isWeiXian = false;
            this._point = null;
        }
        public function dispose():void
        {
            this.reset();
            nodePool.push(this);
        }

    }
}//package yr_engine.scene.map.libarys
